import 'package:flutter/cupertino.dart';
import 'package:shimmer/shimmer.dart';
import 'package:ball_lion/resources/colours.dart';

class ShimmerLoading extends StatelessWidget {
  const ShimmerLoading({
    super.key,
    this.color = Colours.greyEE,
    this.highlightColor = Colours.white,
    this.shape = BoxShape.rectangle,
    required this.width,
    required this.height,
    this.radius = 0,
    this.direction = ShimmerDirection.ltr,
  });

  final Color color;
  final Color highlightColor;
  final BoxShape shape;
  final double radius;
  final double width;
  final double height;
  final ShimmerDirection direction;

  @override
  Widget build(BuildContext context) {
    return Shimmer.fromColors(
        baseColor: color,
        highlightColor: highlightColor,
        direction: direction,
        child: Container(
            width: width,
            height: height,
            decoration: BoxDecoration(
                shape: shape,
                color: color,
                borderRadius: shape != BoxShape.circle
                    ? BorderRadius.circular(radius)
                    : null)));
  }
}
